/*
 * @(#)AbstractComponentRole.java   09/10/18
 * 
 * Copyright (C) 2009 Ecole des Mines d'Ales
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Contact: yulinz88@gmail.com
 */



package fr.ema.arch3d.model.architecture.specification;

import fr.ema.arch3d.model.architecture.Interface;
import fr.ema.arch3d.model.architecture.textADL.ADLDoc;

//~--- classes ----------------------------------------------------------------

/**
 * Component role describes the component from a requirement view that indicates
 * what functions should be accomplished by this component. A component role should contain
 * a set of interfaces and its component behavior.
 *
 *
 *
 * @version        1.0, 09/09/13
 * @author         Huaxi (Yulin) ZHANG
 */
public abstract class AbstractComponentRole implements ComponentRole {

    /** the behavior of this component role */
    private String behavior;

    /** the ADL description document of component role */
    private ADLDoc doc;

    /** a set of interfaces processed by this component role */
    private Interface[] interfaces;

    /** the name of this component role */
    private String name;

    /**
     * Constructs  the component role with its name.
     * @param name  the name of this component role.
     * @param interfaces a set of interfaces processed by this component role.
     * @param behavior   the behavior of this component role.
     */
    public AbstractComponentRole(String name, Interface[] interfaces, String behavior) {
        this.name       = name;
        this.interfaces = interfaces;
        this.behavior   = behavior;
    }

    /**
     * Getter of the property <tt>doc</tt>
     *
     * @return  the doc
     */
    public ADLDoc getDoc() {
        return this.doc;
    }

    /**
     * Setter of the property <tt>doc</tt>
     *
     * @param doc  the doc to set
     */
    public void setDoc(ADLDoc doc) {
        this.doc = doc;
    }

    /**
     * Getter of the property <tt>behavior</tt>
     *
     * @return  the behavior
     */
    public String getBehavior() {
        return this.behavior;
    }

    /**
     * Getter of the property <tt>name</tt>
     *
     * @return  the name
     */
    public String getName() {
        return this.name;
    }

    /**
     * Setter of the property <tt>name</tt>
     *
     * @param name  the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Setter of the property <tt>behavior</tt>
     *
     * @param behavior  the behavior to set
     */
    public void setBehavior(String behavior) {
        this.behavior = behavior;
    }

    /**
     * Setter of the property <tt>interfaces</tt>
     *
     * @param interfaces  the interfaces to set
     */
    public void setInterfaces(Interface[] interfaces) {
        this.interfaces = interfaces;
    }

    /**
     * Getter of the property <tt>interfaces</tt>
     *
     * @return  the interfaces
     */
    public Interface[] getInterfaces() {
        return this.interfaces;
    }
}
